CC=ar r
CPP=g++

EXECUTABLE:=base.a

#set Debug or Release
CORE_COMPILE_FLAG:=debug
#CORE_COMPILE_FLAG:=release

DEBUG=$(CORE_COMPILE_FLAG)/
SOURCE:=$(wildcard *.cpp)
OBJECTS:=$(patsubst %.cpp,%.o,$(SOURCE))
OBJSPATH:=$(patsubst %.cpp,$(DEBUG)%.o,$(SOURCE))

CFLAGS=-Wall -I ../../../include -D __linux

$(EXECUTABLE):$(OBJECTS)
	$(CC) ../../../lib/$(DEBUG)$(EXECUTABLE) $(OBJSPATH)

all:$(OBJECTS)
$(OBJECTS):%.o:%.cpp
	$(CPP) -c $(CFLAGS) $< -lpthread -o $(DEBUG)$@ -Wno-deprecated 

.PHONY:clean cleanall
clean:
	-rm -f $(OBJSPATH)
cleanall:clean
	rm $(DEBUG)$(EXECUTABLE)
